if (where == SHORTCUTS_HOME)
goto out;
-
+
n += impl->has_home ? 1 : 0;
if (where == SHORTCUTS_DESKTOP)
g_signal_connect (selection, "changed",
G_CALLBACK (shortcuts_selection_changed_cb), impl);
-
+
g_signal_connect (impl->shortcuts_tree, "row-activated",
G_CALLBACK (shortcuts_row_activated_cb), impl);
focus_chain = g_list_append (focus_chain, hpaned);
gtk_container_set_focus_chain (GTK_CONTAINER (vbox), focus_chain);
g_list_free (focus_chain);
-
+
gtk_widget_pop_composite_child ();
return object;
bookmarks_check_remove_sensitivity (impl);
}
+/* Sets the file chooser to multiple selection mode */
+static void
+set_select_multiple (GtkFileChooserDefault *impl, gboolean select_multiple)
+{
+ /* FIXME: this does not work for folder mode */
+ GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (impl->list));
+
+ impl->select_multiple = select_multiple;
+ gtk_tree_selection_set_mode (selection,
+ (select_multiple ?
+ GTK_SELECTION_MULTIPLE : GTK_SELECTION_BROWSE));
+ /* FIXME: See note in check_preview_change() */
+ check_preview_change (impl);
+}
+
static void
gtk_file_chooser_default_set_property (GObject *object,
guint prop_id,
case GTK_FILE_CHOOSER_PROP_ACTION:
impl->action = g_value_get_enum (value);
if (impl->action == GTK_FILE_CHOOSER_ACTION_SAVE)
- gtk_widget_show (impl->new_folder_button);
+ {
+ gtk_widget_show (impl->new_folder_button);
+
+ if (impl->select_multiple)
+ {
+ g_warning ("Save mode cannot be set in conjunction with multiple selection mode. "
+ "Re-setting to single selection mode.");
+ set_select_multiple (impl, FALSE);
+ }
+ }
else
gtk_widget_hide (impl->new_folder_button);
}
if (select_multiple != impl->select_multiple)
- {
- GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (impl->list));
-
- impl->select_multiple = select_multiple;
- gtk_tree_selection_set_mode (selection,
- (select_multiple ?
- GTK_SELECTION_MULTIPLE : GTK_SELECTION_BROWSE));
- /* FIXME: See note in check_preview_change() */
- check_preview_change (impl);
- }
+ set_select_multiple (impl, select_multiple);
}
break;
case GTK_FILE_CHOOSER_PROP_SHOW_HIDDEN:
gtk_widget_show (impl->filter_combo);
else
gtk_widget_hide (impl->filter_combo);
-}
+}
static void
gtk_file_chooser_default_add_filter (GtkFileChooser *chooser,
model = gtk_combo_box_get_model (GTK_COMBO_BOX (impl->filter_combo));
gtk_tree_model_iter_nth_child (model, &iter, NULL, filter_index);
gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
-
+
g_object_unref (filter);
if (!impl->filters)
GtkTreeIter iter;
int selected, start_row;
gpointer data;
-
+
if (!gtk_tree_model_get_iter (GTK_TREE_MODEL (impl->shortcuts_model), &iter, path))
return;
const gchar *file_part = _gtk_file_chooser_entry_get_file_part (chooser_entry);
GtkFilePath *new_folder = NULL;
- /* If the file part is non-empty, we need to figure out if it
- * refers to a folder within folder. We could optimize the case
- * here where the folder is already loaded for one of our tree models.
- */
- if (file_part[0] == '\0' && gtk_file_path_compare (impl->current_folder, folder_path) != 0)
- new_folder = gtk_file_path_copy (folder_path);
+ if (!folder_path)
+ return; /* The entry got a nonexistent path */
+
+ if (file_part[0] == '\0')
+ {
+ if (gtk_file_path_compare (impl->current_folder, folder_path) != 0)
+ new_folder = gtk_file_path_copy (folder_path);
+ else
+ return;
+ }
else
{
GtkFileFolder *folder = NULL;
GtkFileInfo *info = NULL;
GError *error;
+ /* If the file part is non-empty, we need to figure out if it
+ * refers to a folder within folder. We could optimize the case
+ * here where the folder is already loaded for one of our tree models.
+ */
+
error = NULL;
folder = gtk_file_system_get_folder (impl->file_system, folder_path, GTK_FILE_INFO_IS_FOLDER, &error);
if (!info)
{
- if ((gtk_file_chooser_get_action (GTK_FILE_CHOOSER (impl)) == GTK_FILE_CHOOSER_ACTION_SAVE &&
- !gtk_file_chooser_get_select_multiple (GTK_FILE_CHOOSER (impl))))
+ if (gtk_file_chooser_get_action (GTK_FILE_CHOOSER (impl)) == GTK_FILE_CHOOSER_ACTION_SAVE)
{
g_object_unref (folder);
gtk_file_path_free (subfolder_path);
if (pixbuf)
g_object_unref (pixbuf);
-
+
#if 0
const GtkFileInfo *info = get_list_file_info (impl, iter);